<template>
  <div class="ren">
    <h2>人员信息</h2>
    <h3>姓名：{{personName}}</h3>
    <h3>年龄：{{personAge}}</h3>
    <button @click="showPerson">提示个人信息</button>
  </div>
</template>

<script>
  export default {
    name:'Person',
    data(){
      return {
        personName:'张三',
        personAge:18
      }
    },
    methods:{
      showPerson(){
        alert(`我叫${this.personName}，今年${this.personAge}岁了`)
      }
    }
  }
</script>

<style>
  .ren {
    color: red;
    background-color: skyblue;
    padding: 10px;
  }
</style>